import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/Layout.vue'
import Product from '../views/Product'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    children:[
      {
        path:'',
        name:'Product',
        component:Product,
        meta:{
          isLogin:true
        }
      },
      {
        path:'params',
        name:'Params',
        component:()=>import('../views/Params.vue'),
        meta:{
          isLogin:true
        }
      },
      {
        path:'content',
        name:'Content',
        component:()=>import('../views/Content.vue'),
        meta:{
          isLogin:true
        }
      }
    ]
  },
  {
    path:'/login',
    name:'Login',
    component:()=>import('../views/Login.vue')
  },
  {
    path:'/ucenter',
    name:'UCenter',
    component:()=>import('../views/UCenter.vue'),
    meta:{
      isLogin:true
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
